<?php

namespace app\backend\controller;

use app\backend\controller\Common;
use app\backend\model\Classify;
use app\BaseController;
use think\captcha\facade\Captcha;
use think\facade\Session;
use think\middleware\SessionInit;
use think\facade\View;
use app\backend\model\Response;
use think\facade\Db;
use lib\Rule;

class Firstpage extends Common
{
    public function index() {

        $list = $this->classifyList();

        return view('index', ['list' => $list]);
    }

    public function classifyList() {
        $res = Db::table('classify')->field('id,name,description,pid')->select();
        
        $list = Rule::Rulelayer($res, $pid=0);
        return $list;
    }
}